home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / wardner.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  31KB  |  845 lines

  1. /***************************************************************************
  2.  
  3.         ToaPlan game hardware from 1987
  4.         --------------------------------
  5.         Driver by: Quench
  6.  
  7.  
  8. Supported games:
  9.  
  10.     Toaplan Board Number:    TP-009
  11.     Taito Game Number:        B25
  12.         Wardners Forest (World)
  13.         Pyros            (USA)
  14.         Wardna no Mori    (Japan)
  15.  
  16. Notes:
  17.         Basically the same video and machine hardware as Flying shark,
  18.           except for the Main CPU which is a Z80 here.
  19.         See twincobr.c machine and video drivers to complete the
  20.           hardware setup.
  21.         Also see Input Port definition header below, for instructions
  22.           on how to enter test mode.
  23.  
  24. **************************** Memory & I/O Maps *****************************
  25. Z80:(0)  Main CPU
  26. 0000-6fff Main ROM
  27. 7000-7fff Main RAM
  28. 8000-ffff Level and scenery ROMS. This is banked with the following
  29. 8000-8fff Sprite RAM
  30. a000-adff Pallette RAM
  31. c000-c7ff Sound RAM - shared with C000-C7FF in Z80(1) RAM
  32.  
  33. in:
  34. 50        DSW A
  35. 52        DSW B
  36. 54        Player 1 controls
  37. 56        Player 2 controls
  38. 58        VBlank (bit 7) and coin-in/start inputs
  39. 60        LSB data from char display layer
  40. 61        MSB data from char display layer
  41. 62        LSB data from BG   display layer
  42. 63        MSB data from BG   display layer
  43. 64        LSB data from FG   display layer
  44. 65        MSB data from FG   display layer
  45.  
  46. out:
  47. 00        6845 CRTC offset register
  48. 02        6845 CRTC register data
  49. 10        char scroll LSB   < Y >
  50. 11        char scroll MSB   < Y >
  51. 12        char scroll LSB     X
  52. 13        char scroll MSB     X
  53. 14        char LSB RAM offset     20h * 40h  (0-07ff) and (4000-47ff) ???
  54. 15        char MSB RAM offset
  55. 20        BG   scroll LSB   < Y >
  56. 21        BG   scroll MSB   < Y >
  57. 22        BG   scroll LSB     X
  58. 23        BG   scroll MSB     X
  59. 24        BG   LSB RAM offset     40h * 40h  (0-0fff)
  60. 25        BG   MSB RAM offset
  61. 30        FG   scroll LSB   < Y >
  62. 31        FG   scroll MSB   < Y >
  63. 32        FG   scroll LSB     X
  64. 33        FG   scroll MSB     X
  65. 34        FG   LSB RAM offset     40h * 40h  (0-0fff)
  66. 35        FG   MSB RAM offset
  67. 40        spare scroll LSB  < Y >  (Not used)
  68. 41        spare scroll MSB  < Y >  (Not used)
  69. 5a-5c    Control registers
  70.         bits 7-4 always 0
  71.         bits 3-1 select the control signal to drive.
  72.         bit   0  is the value passed to the control signal.
  73. 5a        data
  74.         00-01    INT line to TMS320C10 DSP (Active low trigger)
  75.         0c-0d    lockout for coin A input (Active low lockout)
  76.         0e-0f    lockout for coin B input (Active low lockout)
  77. 5c        data
  78.         00-01    ???
  79.         02-03    ???
  80.         04-05    Active low INTerrupt to Z80(0) for screen refresh
  81.         06-07    Flip Screen (Active high flips)
  82.         08-09    Background RAM display bank switch
  83.         0a-0b    Foreground ROM display bank switch (not used here)
  84.         0c-0d    ??? (what the hell does this do ?)
  85. 60        LSB data to char display layer
  86. 61        MSB data to char display layer
  87. 62        LSB data to BG   display layer
  88. 63        MSB data to BG   display layer
  89. 64        LSB data to FG   display layer
  90. 65        MSB data to FG   display layer
  91. 70        ROM bank selector for Z80(0) address 8000-ffff
  92.         data
  93.         00  switch ROM from 8000-ffff out, and put sprite/palette/sound RAM back.
  94.         02  switch lower half of B25-18.ROM  ROM to 8000-ffff
  95.         03  switch upper half of B25-18.ROM  ROM to 8000-ffff
  96.         04  switch lower half of B25-19.ROM  ROM to 8000-ffff
  97.         05  switch upper half of B25-19.ROM  ROM to 8000-ffff
  98.         07  switch               B25-30.ROM  ROM to 8000-ffff
  99.  
  100.  
  101.  
  102. Z80:(1)  Sound CPU
  103. 0000-7fff Main ROM
  104. 8000-807f RAM ???
  105. c000-cfff Sound RAM - C000-C7FF shared with C000-C7FF in Z80(0) ram
  106.  
  107.  
  108.  
  109. TMS320C10 DSP: Harvard type architecture. RAM and ROM on seperate data buses.
  110. 0000-07ff ROM 16-bit opcoodes (word access only)
  111. 0000-0090 Internal RAM (words).    Moved to 8000-8120 for MAME compatibility.
  112.                                 View this memory in the debugger at 4000h
  113. in:
  114. 01        data read from addressed Z80:(0) address space (Main RAM/Sprite RAM)
  115.  
  116. out:
  117. 00        address of Z80:(0) to read/write to
  118. 01        data to write to addressed Z80:(0) address space (Main RAM/Sprite RAM)
  119. 03        bit 15 goes to BIO line of TMS320C10. BIO is a polled input line.
  120.  
  121.  
  122. ***************************************************************************/
  123.  
  124. #include "driver.h"
  125. #include "vidhrdw/generic.h"
  126. #include "vidhrdw/crtc6845.h"
  127.  
  128.  
  129. /******************** Machine stuff **********************/
  130. void wardner_reset(void);
  131. WRITE_HANDLER( wardner_mainram_w );
  132. READ_HANDLER( wardner_mainram_r );
  133. READ_HANDLER( twincobr_dsp_r );
  134. WRITE_HANDLER( twincobr_dsp_w );
  135. WRITE_HANDLER( twincobr_7800c_w );
  136. WRITE_HANDLER( fshark_coin_dsp_w );
  137.  
  138. static int wardner_membank = 0;
  139. extern int twincobr_intenable;
  140.  
  141. extern unsigned char *wardner_mainram;
  142.  
  143.  
  144. /******************** Video stuff **********************/
  145. READ_HANDLER( twincobr_crtc_r );
  146. WRITE_HANDLER( twincobr_crtc_w );
  147.  
  148. WRITE_HANDLER( wardner_videoram_w );
  149. READ_HANDLER( wardner_videoram_r );
  150. WRITE_HANDLER( wardner_bglayer_w );
  151. WRITE_HANDLER( wardner_fglayer_w );
  152. WRITE_HANDLER( wardner_txlayer_w );
  153. WRITE_HANDLER( wardner_bgscroll_w );
  154. WRITE_HANDLER( wardner_fgscroll_w );
  155. WRITE_HANDLER( wardner_txscroll_w );
  156. WRITE_HANDLER( twincobr_exscroll_w );
  157.  
  158. int  twincobr_vh_start(void);
  159. void twincobr_vh_stop(void);
  160. void twincobr_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  161. void twincobr_eof_callback(void);
  162.  
  163. extern int twincobr_display_on;
  164.  
  165. extern unsigned char *videoram;
  166. extern unsigned char *twincobr_fgvideoram;
  167. extern unsigned char *twincobr_bgvideoram;
  168.  
  169.  
  170.  
  171. static int wardner_interrupt(void)
  172. {
  173.     if (twincobr_intenable) {
  174.         twincobr_intenable = 0;
  175.         return interrupt();
  176.     }
  177.     else return ignore_interrupt();
  178. }
  179.  
  180.  
  181. static WRITE_HANDLER( CRTC_add_w )
  182. {
  183.     crtc6845_address_w(offset, data);
  184. }
  185.  
  186. static WRITE_HANDLER( CRTC_data_w )
  187. {
  188.     crtc6845_register_w(0, data);
  189.     twincobr_display_on = 1;
  190. }
  191.  
  192. static READ_HANDLER( wardner_sprite_r )
  193. {
  194.     return spriteram[offset];
  195. }
  196.  
  197. static WRITE_HANDLER( wardner_sprite_w )
  198. {
  199.     spriteram[offset] = data;
  200. }
  201.  
  202.  
  203. static WRITE_HANDLER( wardner_ramrom_banks_w )
  204. {
  205.     if (wardner_membank != data) {
  206.         int bankaddress = 0;
  207.  
  208.         unsigned char *RAM = memory_region(REGION_CPU1);
  209.  
  210.         wardner_membank = data;
  211.  
  212.         if (data) {
  213.             install_mem_read_handler (0, 0x8000, 0xffff, MRA_BANK1);
  214.             switch (data) {
  215.                 case 2:  bankaddress = 0x10000; break;
  216.                 case 3:  bankaddress = 0x18000; break;
  217.                 case 4:  bankaddress = 0x20000; break;
  218.                 case 5:  bankaddress = 0x28000; break;
  219.                 case 7:  bankaddress = 0x38000; break;
  220.                 case 1:  bankaddress = 0x08000; break; /* not used */
  221.                 case 6:  bankaddress = 0x30000; break; /* not used */
  222.                 default: bankaddress = 0x00000; break; /* not used */
  223.             }
  224.             cpu_setbank(1,&RAM[bankaddress]);
  225.         }
  226.         else {
  227.             cpu_setbank(1,&RAM[0x0000]);
  228.             install_mem_read_handler (0, 0x8000, 0x8fff, wardner_sprite_r);
  229.             install_mem_read_handler (0, 0xa000, 0xadff, paletteram_r);
  230.             install_mem_read_handler (0, 0xae00, 0xafff, MRA_BANK2);
  231.             install_mem_read_handler (0, 0xc000, 0xc7ff, MRA_BANK3);
  232.         }
  233.     }
  234. }
  235.  
  236.  
  237. static struct MemoryReadAddress readmem[] =
  238. {
  239.     { 0x0000, 0x6fff, MRA_ROM },            /* Main CPU ROM code */
  240.     { 0x7000, 0x7fff, wardner_mainram_r },    /* Main RAM */
  241.     { 0x8000, 0x8fff, wardner_sprite_r },    /* Sprite RAM data */
  242.     { 0x9000, 0x9fff, MRA_ROM },            /* Banked ROM */
  243.     { 0xa000, 0xadff, paletteram_r },        /* Palette RAM */
  244.     { 0xae00, 0xafff, MRA_BANK2 },            /* Unused Palette RAM */
  245.     { 0xb000, 0xbfff, MRA_ROM },            /* Banked ROM */
  246.     { 0xc000, 0xc7ff, MRA_BANK3 },            /* Shared RAM with Sound CPU RAM */
  247.     { 0xc800, 0xffff, MRA_ROM },            /* Banked ROM */
  248.     { -1 }  /* end of table */
  249. };
  250.  
  251. static struct MemoryWriteAddress writemem[] =
  252. {
  253.     { 0x0000, 0x6fff, MWA_ROM },
  254.     { 0x7000, 0x7fff, wardner_mainram_w, &wardner_mainram },
  255.     { 0x8000, 0x8fff, wardner_sprite_w, &spriteram, &spriteram_size },
  256.     { 0x9000, 0x9fff, MWA_ROM },
  257.     { 0xa000, 0xadff, paletteram_xBBBBBGGGGGRRRRR_w, &paletteram },
  258.     { 0xae00, 0xafff, MWA_BANK2 },
  259.     { 0xb000, 0xbfff, MWA_ROM },
  260.     { 0xc000, 0xc7ff, MWA_BANK3 },
  261.     { 0xc800, 0xffff, MWA_ROM },
  262.     { -1 }    /* end of table */
  263. };
  264.  
  265. static struct MemoryReadAddress sound_readmem[] =
  266. {
  267.     { 0x0000, 0x7fff, MRA_ROM },
  268.     { 0x8000, 0x807f, MRA_BANK4 },
  269.     { 0xc000, 0xc7ff, MRA_BANK3 },
  270.     { 0xc800, 0xcfff, MRA_BANK5 },
  271.     { -1 }
  272. };
  273.  
  274. static struct MemoryWriteAddress sound_writemem[] =
  275. {
  276.     { 0x0000, 0x7fff, MWA_ROM },
  277.     { 0x8000, 0x807f, MWA_BANK4 },
  278.     { 0xc000, 0xc7ff, MWA_BANK3 },
  279.     { 0xc800, 0xcfff, MWA_BANK5 },
  280.     { -1 }
  281. };
  282.  
  283. static struct MemoryReadAddress DSP_readmem[] =
  284. {
  285.     { 0x0000, 0x0bff, MRA_ROM },    /* 0x600 words */
  286.     { 0x8000, 0x811f, MRA_RAM },    /* The real DSP has this at address 0 */
  287.                                     /* View this at 4000h in the debugger */
  288.     { -1 }
  289. };
  290.  
  291. static struct MemoryWriteAddress DSP_writemem[] =
  292. {
  293.     { 0x0000, 0x0bff, MWA_ROM },    /* 0x600 words */
  294.     { 0x8000, 0x811f, MWA_RAM },    /* The real DSP has this at address 0 */
  295.                                     /* View this at 4000h in the debugger */
  296.     { -1 }
  297. };
  298.  
  299.  
  300. static struct IOReadPort readport[] =
  301. {
  302.     { 0x50, 0x50, input_port_3_r },            /* DSW A */
  303.     { 0x52, 0x52, input_port_4_r },            /* DSW B */
  304.     { 0x54, 0x54, input_port_1_r },            /* Player 1 */
  305.     { 0x56, 0x56, input_port_2_r },            /* Player 2 */
  306.     { 0x58, 0x58, input_port_0_r },            /* V-Blank/Coin/Start */
  307.     { 0x60, 0x65, wardner_videoram_r },        /* data from video layer RAM */
  308.     { -1 }
  309. };
  310.  
  311. static struct IOWritePort writeport[] =
  312. {
  313.     { 0x00, 0x02, twincobr_crtc_w },
  314.     { 0x10, 0x13, wardner_txscroll_w },        /* scroll text layer */
  315.     { 0x14, 0x15, wardner_txlayer_w },        /* offset in text video RAM */
  316.     { 0x20, 0x23, wardner_bgscroll_w },        /* scroll bg layer */
  317.     { 0x24, 0x25, wardner_bglayer_w },        /* offset in bg video RAM */
  318.     { 0x30, 0x33, wardner_fgscroll_w },        /* scroll fg layer */
  319.     { 0x34, 0x35, wardner_fglayer_w },        /* offset in fg video RAM */
  320.     { 0x40, 0x43, twincobr_exscroll_w },    /* scroll extra layer (not used) */
  321.     { 0x60, 0x65, wardner_videoram_w },        /* data for video layer RAM */
  322.     { 0x5a, 0x5a, fshark_coin_dsp_w },        /* Machine system control */
  323.     { 0x5c, 0x5c, twincobr_7800c_w },        /* Machine system control */
  324.     { 0x70, 0x70, wardner_ramrom_banks_w },    /* ROM bank select */
  325.     { -1 }
  326. };
  327.  
  328. static struct IOReadPort sound_readport[] =
  329. {
  330.     { 0x00, 0x00, YM3812_status_port_0_r },
  331.     { -1 }
  332. };
  333.  
  334. static struct IOWritePort sound_writeport[] =
  335. {
  336.     { 0x00, 0x00, YM3812_control_port_0_w },
  337.     { 0x01, 0x01, YM3812_write_port_0_w },
  338.     { -1 }
  339. };
  340.  
  341. static struct IOReadPort DSP_readport[] =
  342. {
  343.     { 0x01, 0x01, twincobr_dsp_r },
  344.     { -1 }
  345. };
  346. static struct IOWritePort DSP_writeport[] =
  347. {
  348.     { 0x00,  0x03, twincobr_dsp_w },
  349.     { -1 }
  350. };
  351.  
  352.  
  353.  
  354. /*****************************************************************************
  355.     Input Port definitions
  356.  
  357.     There is a test mode for button/switch tests. To enter Test mode,
  358.     set the Cross Hatch Pattern DSW to on, restart and then press
  359.     player 1 start button when in the cross-hatch screen.
  360. *****************************************************************************/
  361.  
  362. #define  WARDNER_PLAYER_INPUT( player )                                         \
  363.     PORT_START                 /* Player 1 button 3 skips video RAM tests */     \
  364.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | player ) \
  365.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | player ) \
  366.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | player ) \
  367.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | player ) \
  368.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | player)    /* Fire */         \
  369.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | player)    /* Jump */         \
  370.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 | player)    /* Shot C */     \
  371.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 | player)    /* Shot D */
  372.  
  373. #define  WARDNER_SYSTEM_INPUTS                                                \
  374.     PORT_START                /* test button doesnt seem to do anything ? */    \
  375.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN3 )        /* Service button */    \
  376.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )                                \
  377.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )    /* Test button */        \
  378.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )                                \
  379.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )                                \
  380.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )                            \
  381.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )                            \
  382.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )    /* V-Blank */
  383.  
  384. #define  PYROS_DSW_A                                    \
  385.     PORT_START        /* DSW A */                            \
  386.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )        \
  387.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )        \
  388.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )        \
  389.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )    \
  390.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  391.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )            \
  392.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )    \
  393.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  394.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )            \
  395.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )    \
  396.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )            \
  397.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )            \
  398.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )        \
  399.     PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )        \
  400.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )        \
  401.     PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )        \
  402.     PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )        \
  403.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )        \
  404.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )        \
  405.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )        \
  406.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )        \
  407.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  408.  
  409. #define  WARDNER_DSW_B                                    \
  410.     PORT_START        /* DSW B */                            \
  411.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )    \
  412.     PORT_DIPSETTING(    0x01, "Easy" )                    \
  413.     PORT_DIPSETTING(    0x00, "Normal" )                \
  414.     PORT_DIPSETTING(    0x02, "Hard" )                    \
  415.     PORT_DIPSETTING(    0x03, "Hardest" )                \
  416.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )    \
  417.     PORT_DIPSETTING(    0x00, "30000 & 80000" )            \
  418.     PORT_DIPSETTING(    0x04, "50000 & 100000" )        \
  419.     PORT_DIPSETTING(    0x08, "30000" )                    \
  420.     PORT_DIPSETTING(    0x0c, "50000" )                    \
  421.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )        \
  422.     PORT_DIPSETTING(    0x30, "1" )                        \
  423.     PORT_DIPSETTING(    0x00, "3" )                        \
  424.     PORT_DIPSETTING(    0x10, "4" )                        \
  425.     PORT_DIPSETTING(    0x20, "5" )                        \
  426.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )        \
  427.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  428.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )            \
  429.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )        \
  430.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )            \
  431.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  432.  
  433.  
  434.  
  435. INPUT_PORTS_START( wardner )
  436.     WARDNER_SYSTEM_INPUTS
  437.     WARDNER_PLAYER_INPUT( IPF_PLAYER1 )
  438.     WARDNER_PLAYER_INPUT( IPF_PLAYER2 )
  439.  
  440.     PORT_START        /* DSW A */
  441.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
  442.     PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
  443.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  444.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
  445.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  446.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  447.     PORT_DIPNAME( 0x04, 0x00, "Cross Hatch Pattern" )
  448.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  449.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  450.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
  451.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  452.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  453.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
  454.     PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
  455.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  456.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  457.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  458.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
  459.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  460.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  461.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
  462.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
  463.  
  464.     WARDNER_DSW_B
  465. INPUT_PORTS_END
  466.  
  467. INPUT_PORTS_START( pyros )
  468.     WARDNER_SYSTEM_INPUTS
  469.     WARDNER_PLAYER_INPUT( IPF_PLAYER1 )
  470.     WARDNER_PLAYER_INPUT( IPF_PLAYER2 )
  471.     PYROS_DSW_A
  472.  
  473.     PORT_START        /* DSW B */
  474.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
  475.     PORT_DIPSETTING(    0x01, "Easy" )
  476.     PORT_DIPSETTING(    0x00, "Normal" )
  477.     PORT_DIPSETTING(    0x02, "Hard" )
  478.     PORT_DIPSETTING(    0x03, "Hardest" )
  479.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  480.     PORT_DIPSETTING(    0x00, "30000 & 80000" )
  481.     PORT_DIPSETTING(    0x04, "50000 & 100000" )
  482.     PORT_DIPSETTING(    0x08, "50000" )
  483.     PORT_DIPSETTING(    0x0c, "100000" )
  484.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
  485.     PORT_DIPSETTING(    0x30, "1" )
  486.     PORT_DIPSETTING(    0x00, "3" )
  487.     PORT_DIPSETTING(    0x10, "4" )
  488.     PORT_DIPSETTING(    0x20, "5" )
  489.     PORT_DIPNAME( 0x40, 0x00, "Allow Continue" )
  490.     PORT_DIPSETTING(    0x40, DEF_STR( No ) )
  491.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  492.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  493.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  494.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  495. INPUT_PORTS_END
  496.  
  497. INPUT_PORTS_START( wardnerj )
  498.     WARDNER_SYSTEM_INPUTS
  499.     WARDNER_PLAYER_INPUT( IPF_PLAYER1 )
  500.     WARDNER_PLAYER_INPUT( IPF_PLAYER2 )
  501.     PYROS_DSW_A
  502.     WARDNER_DSW_B
  503. INPUT_PORTS_END
  504.  
  505.  
  506.  
  507. static struct GfxLayout charlayout =
  508. {
  509.     8,8,    /* 8*8 characters */
  510.     2048,    /* 2048 characters */
  511.     3,        /* 3 bits per pixel */
  512.     { 0*2048*8*8, 1*2048*8*8, 2*2048*8*8 }, /* the bitplanes are separated */
  513.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  514.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  515.     8*8        /* every char takes 8 consecutive bytes */
  516. };
  517.  
  518. static struct GfxLayout tilelayout =
  519. {
  520.     8,8,    /* 8*8 tiles */
  521.     4096,    /* 4096 tiles */
  522.     4,        /* 4 bits per pixel */
  523.     { 0*4096*8*8, 1*4096*8*8, 2*4096*8*8, 3*4096*8*8 }, /* the bitplanes are separated */
  524.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  525.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  526.     8*8        /* every tile takes 8 consecutive bytes */
  527. };
  528.  
  529. static struct GfxLayout spritelayout =
  530. {
  531.     16,16,    /* 16*16 sprites */
  532.     2048,    /* 2048 sprites */
  533.     4,        /* 4 bits per pixel */
  534.     { 0*2048*32*8, 1*2048*32*8, 2*2048*32*8, 3*2048*32*8 }, /* the bitplanes are separated */
  535.     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
  536.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  537.             8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
  538.     32*8    /* every sprite takes 32 consecutive bytes */
  539. };
  540.  
  541.  
  542. /* handler called by the 3812 emulator when the internal timers cause an IRQ */
  543. static void irqhandler(int linestate)
  544. {
  545.     cpu_set_irq_line(1,0,linestate);
  546. }
  547.  
  548. static struct YM3812interface ym3812_interface =
  549. {
  550.     1,                /* 1 chip */
  551.     24000000/7,        /* 3.43 MHz ??? */
  552.     { 100 },        /* volume */
  553.     { irqhandler },
  554. };
  555.  
  556.  
  557. static struct GfxDecodeInfo gfxdecodeinfo[] =
  558. {
  559.     { REGION_GFX1, 0x00000, &charlayout,   1536, 32 },    /* colors 1536-1791 */
  560.     { REGION_GFX2, 0x00000, &tilelayout,   1280, 16 },    /* colors 1280-1535 */
  561.     { REGION_GFX3, 0x00000, &tilelayout,   1024, 16 },    /* colors 1024-1079 */
  562.     { REGION_GFX4, 0x00000, &spritelayout,    0, 64 },    /* colors    0-1023 */
  563.     { -1 } /* end of array */
  564. };
  565.  
  566.  
  567. static struct MachineDriver machine_driver_wardner =
  568. {
  569.     /* basic machine hardware */
  570.     {
  571.         {
  572.             CPU_Z80,
  573.             24000000/4,            /* 6 MHz ??? - Real board crystal is 24Mhz */
  574.             readmem,writemem,
  575.             readport,
  576.             writeport,
  577.             wardner_interrupt,1
  578.         },
  579.         {
  580.             CPU_Z80,
  581.             24000000/7,            /* 3.43 MHz ??? */
  582.             sound_readmem,sound_writemem,
  583.             sound_readport,sound_writeport,
  584.             ignore_interrupt,0    /* IRQs are caused by the YM3812 */
  585.         },
  586.         {
  587.             CPU_TMS320C10,
  588.             24000000/7,            /* 3.43 MHz ??? */
  589.             DSP_readmem,DSP_writemem,
  590.             DSP_readport,DSP_writeport,
  591.             ignore_interrupt,0    /* IRQs are caused by Z80(0) */
  592.         },
  593.     },
  594.     56, DEFAULT_REAL_60HZ_VBLANK_DURATION,  /* frames per second, vblank duration */
  595.     100,                                    /* 100 CPU slices per frame */
  596.     wardner_reset,
  597.  
  598.     /* video hardware */
  599.     64*8, 32*8, { 0*8, 40*8-1, 0*8, 30*8-1 },
  600.     gfxdecodeinfo,
  601.     1792, 1792,
  602.     0,
  603.  
  604.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM,
  605.     twincobr_eof_callback,
  606.     twincobr_vh_start,
  607.     twincobr_vh_stop,
  608.     twincobr_vh_screenrefresh,
  609.  
  610.     /* sound hardware */
  611.     0,0,0,0,
  612.     {
  613.         {
  614.             SOUND_YM3812,
  615.             &ym3812_interface
  616.         },
  617.     },
  618. };
  619.  
  620.  
  621.  
  622.  
  623. /***************************************************************************
  624.  
  625.   Game driver(s)
  626.  
  627. ***************************************************************************/
  628.  
  629.  
  630. ROM_START( wardner )
  631.     ROM_REGION( 0x48000, REGION_CPU1 )    /* Banked Main Z80 code */
  632.     ROM_LOAD( "wardner.17", 0x00000, 0x08000, 0xc5dd56fd )    /* Main Z80 code */
  633.     ROM_LOAD( "b25-18.rom", 0x18000, 0x10000, 0x9aab8ee2 )    /* OBJ ROMs */
  634.     ROM_LOAD( "b25-19.rom", 0x28000, 0x10000, 0x95b68813 )
  635.     ROM_LOAD( "wardner.20", 0x40000, 0x08000, 0x347f411b )
  636.  
  637.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  638.     ROM_LOAD( "b25-16.rom", 0x00000, 0x08000, 0xe5202ff8 )
  639.  
  640.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  641. #ifndef LSB_FIRST
  642.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1000, 0x0400, 0x70b537b9 ) /* lsb */
  643.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1000, 0x0400, 0x6edb2de8 )
  644.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1400, 0x0200, 0xac843ca6 )
  645.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1400, 0x0200, 0x50452ff8 )
  646.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1800, 0x0400, 0xcc5b3f53 ) /* msb */
  647.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1800, 0x0400, 0x47351d55 )
  648.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1c00, 0x0200, 0x9dfffaff )
  649.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1c00, 0x0200, 0x712bad47 )
  650. #else
  651.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1000, 0x0400, 0xcc5b3f53 ) /* msb */
  652.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1000, 0x0400, 0x47351d55 )
  653.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1400, 0x0200, 0x9dfffaff )
  654.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1400, 0x0200, 0x712bad47 )
  655.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1800, 0x0400, 0x70b537b9 ) /* lsb */
  656.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1800, 0x0400, 0x6edb2de8 )
  657.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1c00, 0x0200, 0xac843ca6 )
  658.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1c00, 0x0200, 0x50452ff8 )
  659. #endif
  660.  
  661.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  662.     ROM_LOAD( "wardner.07", 0x00000, 0x04000, 0x1392b60d )
  663.     ROM_LOAD( "wardner.06", 0x04000, 0x04000, 0x0ed848da )
  664.     ROM_LOAD( "wardner.05", 0x08000, 0x04000, 0x79792c86 )
  665.  
  666.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  667.     ROM_LOAD( "b25-12.rom",  0x00000, 0x08000, 0x15d08848 )
  668.     ROM_LOAD( "b25-15.rom",  0x08000, 0x08000, 0xcdd2d408 )
  669.     ROM_LOAD( "b25-14.rom",  0x10000, 0x08000, 0x5a2aef4f )
  670.     ROM_LOAD( "b25-13.rom",  0x18000, 0x08000, 0xbe21db2b )
  671.  
  672.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  673.     ROM_LOAD( "b25-08.rom",  0x00000, 0x08000, 0x883ccaa3 )
  674.     ROM_LOAD( "b25-11.rom",  0x08000, 0x08000, 0xd6ebd510 )
  675.     ROM_LOAD( "b25-10.rom",  0x10000, 0x08000, 0xb9a61e81 )
  676.     ROM_LOAD( "b25-09.rom",  0x18000, 0x08000, 0x585411b7 )
  677.  
  678.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  679.     ROM_LOAD( "b25-01.rom",  0x00000, 0x10000, 0x42ec01fb )
  680.     ROM_LOAD( "b25-02.rom",  0x10000, 0x10000, 0x6c0130b7 )
  681.     ROM_LOAD( "b25-03.rom",  0x20000, 0x10000, 0xb923db99 )
  682.     ROM_LOAD( "b25-04.rom",  0x30000, 0x10000, 0x8059573c )
  683.  
  684.     ROM_REGION( 0x260, REGION_PROMS )        /* nibble bproms, lo/hi order to be determined */
  685.     ROM_LOAD( "82s129.b19",  0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  686.     ROM_LOAD( "82s129.b18",  0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  687.     ROM_LOAD( "82s123.b21",  0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  688.     ROM_LOAD( "82s123.c6",   0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  689.     ROM_LOAD( "82s123.f1",   0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  690. ROM_END
  691.  
  692. ROM_START( pyros )
  693.     ROM_REGION( 0x48000, REGION_CPU1 )    /* Banked Z80 code */
  694.     ROM_LOAD( "b25-29.rom", 0x00000, 0x08000, 0xb568294d )    /* Main Z80 code */
  695.     ROM_LOAD( "b25-18.rom", 0x18000, 0x10000, 0x9aab8ee2 )    /* OBJ ROMs */
  696.     ROM_LOAD( "b25-19.rom", 0x28000, 0x10000, 0x95b68813 )
  697.     ROM_LOAD( "b25-30.rom", 0x40000, 0x08000, 0x5056c799 )
  698.  
  699.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  700.     ROM_LOAD( "b25-16.rom", 0x00000, 0x08000, 0xe5202ff8 )
  701.  
  702.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  703. #ifndef LSB_FIRST
  704.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1000, 0x0400, 0x70b537b9 ) /* lsb */
  705.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1000, 0x0400, 0x6edb2de8 )
  706.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1400, 0x0200, 0xac843ca6 )
  707.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1400, 0x0200, 0x50452ff8 )
  708.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1800, 0x0400, 0xcc5b3f53 ) /* msb */
  709.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1800, 0x0400, 0x47351d55 )
  710.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1c00, 0x0200, 0x9dfffaff )
  711.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1c00, 0x0200, 0x712bad47 )
  712. #else
  713.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1000, 0x0400, 0xcc5b3f53 ) /* msb */
  714.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1000, 0x0400, 0x47351d55 )
  715.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1400, 0x0200, 0x9dfffaff )
  716.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1400, 0x0200, 0x712bad47 )
  717.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1800, 0x0400, 0x70b537b9 ) /* lsb */
  718.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1800, 0x0400, 0x6edb2de8 )
  719.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1c00, 0x0200, 0xac843ca6 )
  720.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1c00, 0x0200, 0x50452ff8 )
  721. #endif
  722.  
  723.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  724.     ROM_LOAD( "b25-35.rom", 0x00000, 0x04000, 0xfec6f0c0 )
  725.     ROM_LOAD( "b25-34.rom", 0x04000, 0x04000, 0x02505dad )
  726.     ROM_LOAD( "b25-33.rom", 0x08000, 0x04000, 0x9a55fcb9 )
  727.  
  728.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  729.     ROM_LOAD( "b25-12.rom",  0x00000, 0x08000, 0x15d08848 )
  730.     ROM_LOAD( "b25-15.rom",  0x08000, 0x08000, 0xcdd2d408 )
  731.     ROM_LOAD( "b25-14.rom",  0x10000, 0x08000, 0x5a2aef4f )
  732.     ROM_LOAD( "b25-13.rom",  0x18000, 0x08000, 0xbe21db2b )
  733.  
  734.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  735.     ROM_LOAD( "b25-08.rom",  0x00000, 0x08000, 0x883ccaa3 )
  736.     ROM_LOAD( "b25-11.rom",  0x08000, 0x08000, 0xd6ebd510 )
  737.     ROM_LOAD( "b25-10.rom",  0x10000, 0x08000, 0xb9a61e81 )
  738.     ROM_LOAD( "b25-09.rom",  0x18000, 0x08000, 0x585411b7 )
  739.  
  740.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  741.     ROM_LOAD( "b25-01.rom",  0x00000, 0x10000, 0x42ec01fb )
  742.     ROM_LOAD( "b25-02.rom",  0x10000, 0x10000, 0x6c0130b7 )
  743.     ROM_LOAD( "b25-03.rom",  0x20000, 0x10000, 0xb923db99 )
  744.     ROM_LOAD( "b25-04.rom",  0x30000, 0x10000, 0x8059573c )
  745.  
  746.     ROM_REGION( 0x260, REGION_PROMS )        /* nibble bproms, lo/hi order to be determined */
  747.     ROM_LOAD( "82s129.b19",  0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  748.     ROM_LOAD( "82s129.b18",  0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  749.     ROM_LOAD( "82s123.b21",  0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  750.     ROM_LOAD( "82s123.c6",   0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  751.     ROM_LOAD( "82s123.f1",   0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  752. ROM_END
  753.  
  754. ROM_START( wardnerj )
  755.     ROM_REGION( 0x48000, REGION_CPU1 )    /* Banked Z80 code */
  756.     ROM_LOAD( "b25-17.bin",  0x00000, 0x08000, 0x4164dca9 )    /* Main Z80 code */
  757.     ROM_LOAD( "b25-18.rom",  0x18000, 0x10000, 0x9aab8ee2 )    /* OBJ ROMs */
  758.     ROM_LOAD( "b25-19.rom",  0x28000, 0x10000, 0x95b68813 )
  759.     ROM_LOAD( "b25-20.bin",  0x40000, 0x08000, 0x1113ad38 )
  760.  
  761.     ROM_REGION( 0x10000, REGION_CPU2 )    /* Sound Z80 code */
  762.     ROM_LOAD( "b25-16.rom", 0x00000, 0x08000, 0xe5202ff8 )
  763.  
  764.     ROM_REGION( 0x10000, REGION_CPU3 )    /* Co-Processor TMS320C10 MCU code */
  765. #ifndef LSB_FIRST
  766.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1000, 0x0400, 0x70b537b9 ) /* lsb */
  767.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1000, 0x0400, 0x6edb2de8 )
  768.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1400, 0x0200, 0xac843ca6 )
  769.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1400, 0x0200, 0x50452ff8 )
  770.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1800, 0x0400, 0xcc5b3f53 ) /* msb */
  771.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1800, 0x0400, 0x47351d55 )
  772.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1c00, 0x0200, 0x9dfffaff )
  773.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1c00, 0x0200, 0x712bad47 )
  774. #else
  775.     ROM_LOAD_NIB_HIGH( "82s137.1d",  0x1000, 0x0400, 0xcc5b3f53 ) /* msb */
  776.     ROM_LOAD_NIB_LOW ( "82s137.1e",  0x1000, 0x0400, 0x47351d55 )
  777.     ROM_LOAD_NIB_HIGH( "82s131.3b",  0x1400, 0x0200, 0x9dfffaff )
  778.     ROM_LOAD_NIB_LOW ( "82s131.3a",  0x1400, 0x0200, 0x712bad47 )
  779.     ROM_LOAD_NIB_HIGH( "82s137.3d",  0x1800, 0x0400, 0x70b537b9 ) /* lsb */
  780.     ROM_LOAD_NIB_LOW ( "82s137.3e",  0x1800, 0x0400, 0x6edb2de8 )
  781.     ROM_LOAD_NIB_HIGH( "82s131.2a",  0x1c00, 0x0200, 0xac843ca6 )
  782.     ROM_LOAD_NIB_LOW ( "82s131.1a",  0x1c00, 0x0200, 0x50452ff8 )
  783. #endif
  784.  
  785.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )    /* chars */
  786.     ROM_LOAD( "b25-07.bin", 0x00000, 0x04000, 0x50e329e0 )
  787.     ROM_LOAD( "b25-06.bin", 0x04000, 0x04000, 0x3bfeb6ae )
  788.     ROM_LOAD( "b25-05.bin", 0x08000, 0x04000, 0xbe36a53e )
  789.  
  790.     ROM_REGION( 0x20000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* fg tiles */
  791.     ROM_LOAD( "b25-12.rom",  0x00000, 0x08000, 0x15d08848 )
  792.     ROM_LOAD( "b25-15.rom",  0x08000, 0x08000, 0xcdd2d408 )
  793.     ROM_LOAD( "b25-14.rom",  0x10000, 0x08000, 0x5a2aef4f )
  794.     ROM_LOAD( "b25-13.rom",  0x18000, 0x08000, 0xbe21db2b )
  795.  
  796.     ROM_REGION( 0x20000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* bg tiles */
  797.     ROM_LOAD( "b25-08.rom",  0x00000, 0x08000, 0x883ccaa3 )
  798.     ROM_LOAD( "b25-11.rom",  0x08000, 0x08000, 0xd6ebd510 )
  799.     ROM_LOAD( "b25-10.rom",  0x10000, 0x08000, 0xb9a61e81 )
  800.     ROM_LOAD( "b25-09.rom",  0x18000, 0x08000, 0x585411b7 )
  801.  
  802.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )    /* sprites */
  803.     ROM_LOAD( "b25-01.rom",  0x00000, 0x10000, 0x42ec01fb )
  804.     ROM_LOAD( "b25-02.rom",  0x10000, 0x10000, 0x6c0130b7 )
  805.     ROM_LOAD( "b25-03.rom",  0x20000, 0x10000, 0xb923db99 )
  806.     ROM_LOAD( "b25-04.rom",  0x30000, 0x10000, 0x8059573c )
  807.  
  808.     ROM_REGION( 0x260, REGION_PROMS )        /* nibble bproms, lo/hi order to be determined */
  809.     ROM_LOAD( "82s129.b19",  0x000, 0x100, 0x24e7d62f )    /* sprite priority control ?? */
  810.     ROM_LOAD( "82s129.b18",  0x100, 0x100, 0xa50cef09 )    /* sprite priority control ?? */
  811.     ROM_LOAD( "82s123.b21",  0x200, 0x020, 0xf72482db )    /* sprite control ?? */
  812.     ROM_LOAD( "82s123.c6",   0x220, 0x020, 0xbc88cced )    /* sprite attribute (flip/position) ?? */
  813.     ROM_LOAD( "82s123.f1",   0x240, 0x020, 0x4fb5df2a )    /* tile to sprite priority ?? */
  814. ROM_END
  815.  
  816.  
  817. static void init_wardner(void)
  818. {
  819.     int A;
  820.     unsigned char datamsb;
  821.     unsigned char datalsb;
  822.  
  823.     unsigned char *DSP_ROMS = memory_region(REGION_CPU3);
  824.  
  825.     /* The ROM loader fixes the nibble images. Here we fix the byte ordering. */
  826.  
  827.     for (A = 0;A < 0x0600;A++)
  828.     {
  829.         datamsb = DSP_ROMS[0x1000 + A];
  830.         datalsb = DSP_ROMS[0x1800 + A];
  831.         DSP_ROMS[(A*2)]   = datamsb;
  832.         DSP_ROMS[(A*2)+1] = datalsb;
  833.  
  834.         DSP_ROMS[0x1000 + A] = 00;
  835.         DSP_ROMS[0x1800 + A] = 00;
  836.     }
  837. }
  838.  
  839.  
  840.  
  841. GAME( 1987, wardner,  0,       wardner, wardner,  wardner, ROT0, "[Toaplan] Taito Corporation Japan", "Wardner (World)" )
  842. GAME( 1987, pyros,    wardner, wardner, pyros,    wardner, ROT0, "[Toaplan] Taito America Corporation", "Pyros (US)" )
  843. GAME( 1987, wardnerj, wardner, wardner, wardnerj, wardner, ROT0, "[Toaplan] Taito Corporation", "Wardna no Mori (Japan)" )
  844.  
  845.